﻿using System.Collections;
using System.Collections.Generic;
using System.Text;
using T.FAS.Runtime.Metadata.Entity.DataModel;

namespace T.FAS.Runtime.DataModel.Dao
{
    public interface IDatabaseDao
    {
        /// <summary>
        /// 获取DB列表
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        List<Database> GetDatabases(Dictionary<string,string> filter);
        /// <summary>
        /// 获取DB By主键id
        /// </summary>
        /// <param name="databaseID"></param>
        /// <returns></returns>
        Database GetDatabaseByID(string databaseID);
        /// <summary>
        /// 添加DB
        /// </summary>
        /// <param name="database"></param>
        void AddDatabase(Database database);

        void AddDatabaseList(List<Database> databaseList);

        /// <summary>
        /// 更新DB
        /// </summary>
        /// <param name="database"></param>
        void UpdateDatabase(Database database);
       
        /// <summary>
        /// 删除DB
        /// </summary>
        /// <param name="filter"></param>
        void DeleteDatabase(Dictionary<string, string> filter);

        /// <summary>
        /// 删除DB
        /// </summary>
        /// <param name="filter"></param>
        void DeleteDatabaseList(List<string> idList);

        /// <summary>
        /// DB Code&DbType唯一性验证
        /// </summary>
        /// <param name="filter"></param>
        int CheckUnique(Dictionary<string, string> filter);
    }

    public interface IFASDatabaseConfigDao
    {
        List<DatabaseConfig> GetDatabaseConfigs(Dictionary<string, string> filter);
        DatabaseConfig GetDatabaseConfigByID(string dbCfgID);
        void AddDatabaseConfig(DatabaseConfig dbCfg);
        void AddDatabaseConfigList(ArrayList dbCfgs);
        void UpdateDatabaseConfig(DatabaseConfig dbCfg);
        void DeleteDatabaseConfig(Dictionary<string, string> filter);
    }
}
